﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace ShootMan
{
    
    public class DefaultEnemyController : MonoBehaviour
    {
        [SerializeField]
        private int _reduceScore = 1;

        void OnCollisionEnter(Collision other)
        {
            if (other.gameObject.layer != (int)GlobalDefines.Layers.Player)
                return;

            if (shaco.GameHelper.objectpool.IsInstantiated(this.gameObject))
                this.gameObject.RecyclingWithPool();
            this.InvokeEvent(new ShootAddScoreEvent() { score = -_reduceScore });
        }
    }
}